< previous page page_354 next page >

Page 354
Access Reporting
Perhaps unknown to many Visual Basic developers, Microsoft Access offers a very powerful and easy-to-use object library for creating, modifying, and deleting reports. Although you can certainly create and delete Access reports through the ActiveX object library via Visual Basic, it's easier to create the reports in Access itself if you and your users have a copy of it. Access 95, 97, and beyond make it easy to create reports with its report wizards. However, for the purposes of this lesson, I concentrate on implementing the classes necessary to open and print existing reports that will be the more common operations you'll perform with Access Reports.
You can activate references to the Access object library by choosing Project|References from the Visual Basic menu. You must have Access installed on your machine, of course (although Visual Basic does ship with an Access object library). When it's activated, simply browse the objects in the library, named Access, in Object Browser. The typical declarations you might use for Access-based reporting include something like the following:
Private theAccessServer As Access.Application
Private theAccessReporter As Access.Report
where theAccessServer and theAccessReporter are your objects, Access.Application is the class of the Microsoft Application itself, and Access.Report is a class of every Access report. Each report is part of a Reports collection you can also access in Visual Basic.
The most common method in the Access object library you'll use is DoCmd. For you Access VBA developers, you'll recognize this command as one you use when programming in Access VBA. The main drawback with using Access is that your clients generally need to have Access installed on their machines. However, VideoSoft, a third-party vendor of Visual Basic controls, has a fairly new component called VS Reports. It is an amazingly useful tool that lets you distribute Access reports with your applications without your clients having to have Access installed. It is very reasonably priced. The vendor can be reached at www.videosoft.com.
Crystal Reporting
Crystal Reports is a third-party control in Visual Basic that allows you to offer some very powerful reporting design and capabilities in your application. However, working with its more advanced features can be cumbersome, especially because Visual Basic tends to ship earlier versions of Crystal Reports. Nonetheless, keeping your reporting requirements as simple as possible without compromising your users' productivity is an ideal strategy.

 
< previous page page_354 next page >

If you like this book, buy it!